package com.yaoxiaowen.project2.util;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.yaoxiaowen.project2.R;


/**
 * author：yaowen on 16/11/21 20:45
 * email：yw43194@ly.com
 */

public class ToastUtils {

    public static void simpleShow(Context context, String text){
        View view = LayoutInflater.from(context).inflate(R.layout.view_toast_simply, null);
        TextView contentTv = (TextView)view.findViewById(R.id.toastContentTv);

        contentTv.setText(text);

        Toast toast= new Toast(context);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.setDuration(Toast.LENGTH_LONG);
        toast.setView(view);
        toast.show();

    }
}
